package my.tutorial.javacore.test;

public class BasicCalculator {
	double result = 0;

	public static void main(String[] args) {
		
		BasicCalculator bc = new BasicCalculator();
		double op1= new java.util.Scanner(System.in).nextDouble();
		char operator= new java.util.Scanner(System.in).nextLine().charAt(0);
		double op2= new java.util.Scanner(System.in).nextDouble();
		
		System.out.println(op1+String.valueOf(operator)+op2+"="+bc.calculate(op1, op2, operator));
	}
	
	public double calculate(double op1, double op2, char operator){
		double result=0;
		switch (operator) {
		case '+':
			result = op1 + op2;
			break;
		case '-':
			result = op1 - op2;
			break;
		case '*':
			result = op1 * op2;
			break;
		case '/':
			result = op1 / op2;
			break;
		default:
			System.err.println("unkown data type!");
		}
		return result;
	}

}
